name: Deploy Cloudflare Worker

on:
  push:
    branches:
      - canary
    paths:
      - tools/workers/**

jobs:
  deploy:
    runs-on: ubuntu-latest
    name: Deploy
    environment: stable
    steps:
      - uses: actions/checkout@v4
      - name: Publish
        uses: cloudflare/wrangler-action@v3.4.1
        with:
          apiToken: ${{ secrets.CF_API_TOKEN }}
          accountId: ${{ secrets.CF_ACCOUNT_ID }}
          workingDirectory: 'tools/workers'
          packageManager: 'yarn'
